package com.frikinet.tools.i18n;

import java.text.MessageFormat;
import java.util.Locale;
import java.util.ResourceBundle;

public class FI18N
{
	private Locale locale = null;
	private ResourceBundle bundle = null;
	
	public FI18N(String bundle, Locale locale)
	{
		this.locale = locale;
		this.bundle = ResourceBundle.getBundle(bundle, this.locale);
	}
	
	public String translate(String key, Object ...args)
	{
		return MessageFormat.format(bundle.getString(key), args);
	}
	
	public boolean hasKey(String key)
	{
		return bundle.containsKey(key);
	}
}

